<?php
// +----------------------------------------------------------------------
// | 07FLYSAAS [基于ThinkPHP5.0开发]
// +----------------------------------------------------------------------
// | Copyright (c) 2025-2035 http://www.07fly.xyz
// +----------------------------------------------------------------------
// | Professional because of focus  Persevering because of happiness
// +----------------------------------------------------------------------
// | Author: 开发人生 <goodkfrs@qq.com>
// +----------------------------------------------------------------------


namespace app\plat\validate;

/**
 * 注册验证器
 */
class Reg extends PlatBase
{
// 验证规则
    protected $rule = [
//        'username' => 'require|email',
        'username' => 'require',
        'password' => 'require',
        'password_confirm' => 'require|confirm:password',
        'verify' => 'require|captcha',
    ];

    // 验证提示
    protected $message = [
        'username.require' => '用户名不能为空',
//        'username.email' => '用户名必须是有效的邮箱地址',
        'password.require' => '密码不能为空',
        'password_confirm.require' => '确认密码不能为空',
        'password_confirm.confirm' => '两次密码不一致',
        'verify.require' => '验证码不能为空',
        'verify.captcha' => '验证码不正确',
    ];

    // 应用场景
    protected $scene = [
        'reg' => ['username', 'password', 'password_confirm'],
    ];
}
